<?php
// Inscription validée
if ($statut == "valide") {
?>

    <h2>Création réussie</h2>
    <p>Votre compte Campus Exchange est maintenant crée !</p>

<?php
// Inscription non validée
} else {

    // Si erreur
    if ($statut == "erreur"): ?>

        <h2>Erreur</h2>
        <p>Votre compte n'a pas été crée. Veuillez vérifier les points suivants:</p>
        <ul>
            <?php foreach ($liste_erreurs as $key => $value): ?>
                <li><?= $key ?> => <?= $value ?></li>
            <?php endforeach; ?>
        </ul>
            
    <?php endif;
    
    // On affiche le formulaire dans tout les cas
    ?>
    <form method="POST" action="">
        <input type="hidden" name="submited" value="true" />
        <div class="cfg-contactform" id="cfg-contactform-4">
            <div class="cfg-contactform-content">

                <div class="cfg-element-container">
                    <div class="cfg-element-set" id="cfg-element-4-9-set" >
                        <div class="cfg-element-content">
                            <span class="cfg-title "  name="titre" id="cfg-element-4-9">Inscription</span>
                        </div>
                    </div>
                </div>

                <div class="cfg-element-container">
                    <label class="cfg-label" id="cfg-element-4-14-label" ><span class="cfg-label-value">Nom</span><span class="cfg-required">*</span></label>

                    <div class="cfg-element-set" id="cfg-element-4-14-set" >
                        <div class="cfg-element-content">
                            <input type="text" class="cfg-type-text cfg-form-value " name="nom" id="cfg-element-4-14"  />
                        </div>
                    </div>

                    <div class="cfg-clear"></div>
                </div>


                <div class="cfg-element-container">
                    <label class="cfg-label" id="cfg-element-4-15-label" ><span class="cfg-label-value">Prénom</span><span class="cfg-required">*</span></label>

                    <div class="cfg-element-set" id="cfg-element-4-15-set" >
                        <div class="cfg-element-content">
                            <input type="text" class="cfg-type-text cfg-form-value " name="prenom" id="cfg-element-4-15"  />
                        </div>
                    </div>

                    <div class="cfg-clear"></div>
                </div>


                <div class="cfg-element-container">
                    <label class="cfg-label" id="cfg-element-4-18-label" ><span class="cfg-label-value">Adresse</span></label>

                    <div class="cfg-element-set" id="cfg-element-4-18-set" >
                        <div class="cfg-element-content">
                            <input type="text" class="cfg-type-text cfg-form-value " name="adresse1" id="cfg-element-4-18"  />
                        </div>
                    </div>

                    <div class="cfg-clear"></div>
                </div>


                <div class="cfg-element-container">
                    <label class="cfg-label" id="cfg-element-4-19-label" ><span class="cfg-label-value"> Complément adresse</span></label>

                    <div class="cfg-element-set" id="cfg-element-4-19-set" >
                        <div class="cfg-element-content">
                            <input type="text" class="cfg-type-text cfg-form-value " name="adresse2" id="cfg-element-4-19"  />
                        </div>
                    </div>

                    <div class="cfg-clear"></div>
                </div>


                <div class="cfg-element-container">
                    <label class="cfg-label" id="cfg-element-4-20-label" ><span class="cfg-label-value">Code Postal</span></label>

                    <div class="cfg-element-set" id="cfg-element-4-20-set" >
                        <div class="cfg-element-content">
                            <input type="text" class="cfg-type-text cfg-form-value " name="cp" id="cfg-element-4-20"  />
                        </div>
                    </div>

                    <div class="cfg-clear"></div>
                </div>


                <div class="cfg-element-container">
                    <label class="cfg-label" id="cfg-element-4-21-label" ><span class="cfg-label-value">Ville</span></label>

                    <div class="cfg-element-set" id="cfg-element-4-21-set" >
                        <div class="cfg-element-content">
                            <input type="text" class="cfg-type-text cfg-form-value " name="ville" id="cfg-element-4-21"  />
                        </div>
                    </div>

                    <div class="cfg-clear"></div>
                </div>


                <div class="cfg-element-container">
                    <label class="cfg-label" id="cfg-element-4-22-label" ><span class="cfg-label-value">Téléphone</span></label>

                    <div class="cfg-element-set" id="cfg-element-4-22-set" >
                        <div class="cfg-element-content">
                            <input type="text" class="cfg-type-text cfg-form-value " name="telephone" id="cfg-element-4-22"  />
                        </div>
                    </div>

                    <div class="cfg-clear"></div>
                </div>


                <div class="cfg-element-container">
                    <label class="cfg-label" id="cfg-element-4-25-label" ><span class="cfg-label-value">E-mail étudiant</span><span class="cfg-required">*</span></label>

                    <div class="cfg-element-set" id="cfg-element-4-25-set" >
                        <div class="cfg-element-content">
                            <input type="text" class="cfg-type-text cfg-form-value " name="mail_etu" id="cfg-element-4-25"  />
                        </div>
                    </div>

                    <div class="cfg-clear"></div>
                </div>


                <div class="cfg-element-container">
                    <label class="cfg-label" id="cfg-element-4-26-label" ><span class="cfg-label-value">E-mail personnel</span></label>

                    <div class="cfg-element-set" id="cfg-element-4-26-set" >
                        <div class="cfg-element-content">
                            <input type="text" class="cfg-type-text cfg-form-value " name="mail_perso" id="cfg-element-4-26"  />
                        </div>
                    </div>

                    <div class="cfg-clear"></div>
                </div>


                <div class="cfg-element-container">
                    <label class="cfg-label" id="cfg-element-4-28-label" ><span class="cfg-label-value">Mot de passe</span><span class="cfg-required">*</span></label>

                    <div class="cfg-element-set" id="cfg-element-4-28-set" >
                        <div class="cfg-element-content">
                            <input type="password" class="cfg-type-text cfg-form-value " name="password1" id="cfg-element-4-28"  />
                        </div>
                    </div>

                    <div class="cfg-clear"></div>
                </div>


                <div class="cfg-element-container">
                    <label class="cfg-label" id="cfg-element-4-29-label" ><span class="cfg-label-value">Vérification mot de passe</span><span class="cfg-required">*</span></label>

                    <div class="cfg-element-set" id="cfg-element-4-29-set" >
                        <div class="cfg-element-content">
                            <input type="password" class="cfg-type-text cfg-form-value " name="password2" id="cfg-element-4-29"  />
                        </div>
                    </div>

                    <div class="cfg-clear"></div>
                </div>


                <div class="cfg-element-container">
                    <div class="cfg-element-set" id="cfg-element-4-30-set" >
                        <div class="cfg-element-content">
                            <input type="submit" class="cfg-submit " name="inscription" id="cfg-element-4-30" value="Inscription"   />
                        </div>
                    </div>
                </div>

            </div><!-- cfg-contactform-content -->

        </div><!-- cfg-contactform -->

    </form> 
<?php } ?>